using System;
using System.Collections;
using System.Configuration;

namespace Ddb_Demo.Config
{
    public class DatabaseSection:ConfigurationSection
    {
        Database tables;
        public DatabaseSection()
        {
            // Create the element.
            tables = new Database();
        }

        [ConfigurationProperty("name",
            DefaultValue = "DDB_ServerSites",
            IsRequired = true,
            IsKey = false)]
        [StringValidator(InvalidCharacters =
            " ~!@#$%^&*()[]{}/;'\"|\\",
            MinLength = 1, MaxLength = 60)]
        public string Name
        {

            get
            {
                return (string)this["name"];
            }
            set
            {
                this["name"] = value;
            }

        }


        [ConfigurationProperty("tables",
           IsDefaultCollection = false)]
        public Database Tables
        {

            get
            {
                Database tablesCollection =
                (Database)base["tables"];
                return tablesCollection;
            }
        }


        protected override void DeserializeSection(
            System.Xml.XmlReader reader)
        {
            base.DeserializeSection(reader);

           
        }

        protected override string SerializeSection(
            ConfigurationElement parentElement,
            string name, ConfigurationSaveMode saveMode)
        {
            string s =
                base.SerializeSection(parentElement,
                name, saveMode);

            // Enter your custom processing code here.

          
            return s;
        }
    }
}
